/* ===== Corps ===== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body:not(#home-body) {
    background: #f0f0f0;
}

.index-container {
    min-height: 100vh;        /* prend toute la hauteur de l’écran */
    display: flex;
    flex-direction: column;   /* empile header, main, footer */
}
main {
    flex: 1;                  /* prend tout l’espace restant */
    margin-bottom: 10px;      /* espace avant le footer */
}


/* ===== Header & Footer ===== */
#app-header, #app-footer {
    background-color: #004680; /* Bleu de l'app */
    color: white;
    text-align: center;
}

#app-header {
    padding: 30px 0;
    font-size: 1.8rem;
    font-weight: bold;
}

span {
  font-size: 4rem;    /* même taille que ton h1 */
}


header nav {
    margin-top: 10px;
    font-size: 1.4rem
}

header nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;         /* plus moderne qu'en inline */
    justify-content: center;
    flex-wrap: wrap;       /* permet de passer à la ligne sur petits écrans */
    gap: 20px;             /* espace entre les liens */
}

header nav ul li a {
    display: inline-block;   /* <== important pour que transform marche */
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

header nav ul li a:hover {
    transform: scale(1.2); /* ici tu verras bien le zoom */
}

#app-footer {
    padding: 12px 0;
    font-size: 1rem;
    background-color: #004680;
    color: white;
    text-align: center;
    margin-top: auto;   /* pousse le footer en bas si la page est courte */
}


/* ===== Container ===== */
.container {
    max-width: 500px;
    margin: 40px auto 80px auto; /* espace au-dessus et en dessous */
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* ===== Labels ===== */
label {
    display: block;
    margin: 10px 0 5px 0;
    font-weight: 500;
}

/* ===== Inputs / Textarea ===== */
input[type="text"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
    box-sizing: border-box;
    resize: vertical;
}


/* ===== Boutons ===== */
button, a.btn:not(.playstore-btn) {
    padding: 12px;
    background-color: #004680;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}
button {
    width: 100%; /* bouton prend toute la largeur */
}

button:enabled:hover, a.btn:not(.playstore-btn):hover {
    box-shadow: 0 4px 15px rgba(0, 120, 215, 0.5); /* halo bleu */
    transform: translateY(-2px); /* petit soulèvement */
}

#generateBtn:disabled {
    background-color: #ccc;
    color: #666;
    cursor: not-allowed;
  }

.options {
    width: 100%;
}

.options .row {
    display: flex;
    justify-content: space-between; /* espace égal entre les 2 labels */
}

.options label {
    flex: 0 0 48%;    /* chaque label prend ~la moitié de la ligne */
    display: flex;
    align-items: center;
}


/* ===== Output & Entropy ===== */
pre {
    background: #e8e8e8;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 1rem;
    margin-bottom: 15px;
    white-space: pre-wrap;
}

.entropy-container {
    margin-top: 10px;
    font-family: Arial, sans-serif;
}

.entropy-bar-container {
    width: 100%;
    padding: 6px;
    box-sizing: border-box;
}

.entropy-bar-track {
    width: 100%;
    height: 15px;
    background-color: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.entropy-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 6px; /* arrondi début ET fin */
    transition: width 0.4s ease, background 0.4s ease; /* animation fluide */
}

input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #004680; /* couleur de coche */
  cursor: pointer;
}

/* Toast global */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #004680;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
}

.toast.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

section {
    padding: 40px 20px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}
section h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: #004680;
}

h1#welcome-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 10px;
    color: #004680;
}

section p, section li {
    font-size: 1rem;
    line-height: 1.6;
}
section img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 15px;
}

.hero {
    text-align: center;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 40px 20px;
    align-items: center;
}
.hero-text h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}
.hero .btn {
    display: inline-block;
    margin-top: 15px;
    padding: 12px 20px;
    background: #004680;
    color: white;
    border-radius: 6px;
    text-decoration: none;
}

ul {
    list-style: none;   /* supprime les puces */
    padding-left: 0;
    margin: 10px 0;
}
li {
    margin-bottom: 8px;
}

.playstore-btn {
  display: inline-block;
  max-width: 220px;       /* limite la taille du badge */
  text-decoration: none;
  transition: transform 0.2s ease;
}

.playstore-btn img {
  width: 100%;            /* responsive */
  height: auto;
  display: block;
}

.playstore-btn:hover {
  transform: scale(1.05);
}

#mobile-icon {
    width: 100px;          /* taille de l'icône mobile */
    height: auto;
}

.playstore-container {
  display: flex;
  align-items: center;       /* centre verticalement */
  gap: 15px;                 /* espace entre l’icône et le badge */
  justify-content: center;   /* centre horizontalement dans le parent */
  flex-wrap: wrap;           /* passe à la ligne si écran trop petit */
}


a.mail-link {
    color: white;
    text-decoration: none;
  }
  a.mail-link:hover {
    text-decoration: underline; /* souligné au survol */
  }

.social-links a i {
    color: #fff; /* blanc */
    font-size: 1.5em;
    margin: 0 8px;
    transition: color 0.2s;
}
.social-links a:hover i {
    color: #ffd700; /* jaune doré au survol, optionnel */
}


/* ===== Table des matières ===== */
.toc {
    margin: 32px auto 32px auto;
    background: #f4f8fc;
    border-radius: 12px;
    padding: 24px 18px;
    max-width: 700px;
    box-shadow: 0 2px 12px rgba(0,72,128,0.07);
}
.toc h2 {
    font-size: 1.4rem;
    color: #004680;
    margin-bottom: 18px;
    text-align: left;
}
.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.toc li {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    background: #fff;
    border-radius: 8px;
    padding: 12px 10px;
    transition: box-shadow 0.2s;
}
.toc li:hover {
    box-shadow: 0 2px 8px rgba(0,72,128,0.08);
}
.toc-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 8px;
    background: #e8e8e8;
    flex-shrink: 0;
}
.toc a {
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    text-decoration: none; /* enlève le soulignage */
    color: inherit;
}
.toc-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 24px;
}
.toc strong {
    font-size: 1.08rem;
    color: #004680;
    margin-bottom: 0;
    margin-right: 18px;
    display: block;
    min-width: 180px;
    text-align: left;
}
.toc span {
    font-size: 0.98rem;
    color: #444;
    display: block;
    text-align: left;
    margin-bottom: 0;
    margin-top: 0;
    flex: 1;
}
@media (max-width: 600px) {
    .toc-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .toc strong {
        min-width: unset;
        margin-right: 0;
        font-size: 1rem;
    }
    .toc span {
        font-size: 0.93rem;
    }
}
.back-to-toc {
    display: inline-block;
    margin-top: 18px;
    font-size: 0.97rem;
    color: #004680;
    text-decoration: underline;
    background: none;
    border: none;
    cursor: pointer;
}

/* --- Version mobile --- */
@media (max-width: 768px) {

    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .container {
        max-width: none;       /* supprime la limite de 500px */
        margin: 20px 10px 80px 10px; /* marge 10px sur les côtés, marge en bas pour le footer */
        border-radius: 0;      /* optionnel : supprime les angles arrondis pour coller au bord */
    }

    #app-header {
        font-size: 1.5rem;
        padding: 15px 0;
    }

    header nav ul {
        flex-direction: column;
        gap: 10px;
    }

    header nav ul li a {
        display: block;
    }
}

/* --- Desktop section formatting simplifié --- */
@media (min-width: 769px) {
  section.left {
    max-width: 80vw;
    min-width: 900px;
    margin: 0 auto;
    padding: 48px 32px;
    text-align: left;
  }
  section.left h2 {
    text-align: center;
    margin-bottom: 36px;
  }
  section.left h3 {
    margin: 48px 0 18px 40px;
    text-align: left;
  }
  section.left .block {
    margin-bottom: 40px;
  }
  section.left .block h3,
  section.left .block p,
  section.left .block ul,
  section.left .block li {
    margin-left: 40px;
    text-align: left;
  }
  section.left .block p {
    margin-bottom: 10px;
  }
  section.left .block p + p {
    margin-top: 4px;
  }
  section.left .block ul {
    margin-bottom: 10px;
  }
  section.left .block li {
    margin-bottom: 6px;
  }
  section.left h3 + p,
  section.left h3 + ul,
  section.left p + h3,
  section.left ul + h3 {
    margin-top: 36px;
  }
  section.left ul {
    margin-bottom: 12px;
  }
  section.left li {
    margin-bottom: 8px;
  }
  section.left p + p {
    margin-top: 8px;
  }
}
@media (min-width: 1200px) {
  section.left .block {
    max-width: 50vw;      /* le texte prend au plus la moitié de l'écran */
    margin-left: 40px;    /* marge à gauche comme avant */
    margin-right: auto;   /* colle à gauche */
  }
  section.left .block h3,
  section.left .block p,
  section.left .block ul,
  section.left .block li {
    margin-left: 0;       /* plus besoin de marge interne */
  }
}

/* Images à droite dans les blocs avec .block-img */
@media (min-width: 900px) {
  .block-img {
    position: relative;
    min-height: 180px;
  }
  .block-img .side-img {
    float: right;
    max-width: 220px;
    width: 30%;
    margin: 0 0 16px 32px;
    border-radius: 8px;
  }
}
@media (max-width: 899px) {
  .block-img .side-img {
    display: block;
    float: none;
    margin: 24px auto 16px auto;
    max-width: 320px;
    width: 100%;
  }
}

.chapter-banner,
.chapter-banner.bottom {
    width: 100%;
    height: 18px;
    background: #004680;
    margin: 0 auto;
    border-radius: 0;
    z-index: 1;
}

.chapter-banner.bottom {
    margin-top: 40px;
    margin-bottom: 40px;
}
@media (max-width: 800px) {
    .chapter-banner,
    .chapter-banner.bottom {
        height: 12px;
    }
}